<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">  
  <title>鲜花列表</title>
 </head>
 <body>
 
 
 <?php
  require_once('inc_admin.php');
  connect();
  //编写sql语句
  $sql = 'select * from flower';
  //echo $sql.'<br/>';  
  $result = fetch_array($sql); 
   
 ?>

 <center><h3>鲜花列表</h3></center>

      <form action="search.php" method="post" name="key" id="key" align="right" >
      <table width="90%">
          <td >请输入鲜花名称：
          <input name="key" type="text" id="key" >
          <input name="submit" type="submit" value="搜索" /></td></table>
        </form>
 <table align="center" width="80%" border=4> 
 <tr>
   <th>鲜花编号</th>
   <th>鲜花标题</th>   
   <th>鲜花图片文件名</th>
   <th>鲜花产地</th>
   <th>鲜花简介</th>
   <th>添加鲜花时间</th>
   <th>点击量</th> 
 </tr>

 <?php
  foreach ($result as $row) {
   echo '<tr>';
   echo '<td>'.$row['zmh_id'].'</td>';
   echo '<td><a href="detail.php?id='.$row['zmh_id'].'">'.$row['zmh_title'].'</a></td>';
   //echo '<td><a href="detail.php"'.$row['zmh_title'].'</td>'; 
   echo '<td>'.$row['zmh_pic'].'</td>'; 
   echo '<td>'.$row['zmh_place'].'</td>';
   echo '<td>'.$row['zmh_intro'].'</td>';
   echo '<td>'.$row['zmh_adddate'].'</td>';  
    echo '<td>'.$row['zmh_hint'].'</td>';   
   echo '<td><a href="#">修改</a> | 
   <a href="delflower.php?id='.$row['zmh_id'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
   echo '</tr>';  
  }
  echo '</table>';    
 ?>
 
 </body>
</html>

